import fetch from "./request.js";

// 查询
export function queryRoleListByPage(data) {
  return fetch("/nb-as/1.0.1/RoleService/queryRoleListByPage", {
    method: "post",
    data: data,
  });
}
// 详情
export function queryRoleDetail(data) {
  return fetch("/nb-as/1.0.1/RoleService/queryRoleDetail", {
    method: "post",
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    data: data,
    withLoading: true,
  });
}
// 新增
export function addRole(data) {
  return fetch("/nb-as/1.0.1/RoleService/addRole", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改
export function updateRole(data) {
  return fetch("/nb-as/1.0.1/RoleService/updateRole", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 删除
export function deleteRole(data) {
  return fetch("/nb-as/1.0.1/RoleService/deleteRole", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 导出角色绑定账号列表
export function exportBindedAccountList(data) {
  return fetch("/nb-as/1.0.1/RoleService/exportBindedAccountList", {
    method: "post",
    data: data,
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    responseType: "blob",
    withLoading: true,
    noInterceptors: true,
  });
}
// 查询角色关联账号列表
export function queryRoleAccountList(data) {
  return fetch("/nb-as/1.0.1/RoleService/queryRoleAccountList", {
    method: "post",
    data: data,
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    withLoading: true,
  });
}
// 修改角色关联账号
export function updateRoleAccount(data) {
  return fetch("/nb-as/1.0.1/RoleService/updateRoleAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 查询角色关联菜单 平铺
export function queryRolePageList(data) {
  return fetch("/nb-as/1.0.1/RoleService/queryRolePageList", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 查询角色关联菜单树
export function queryRolePageTree(data) {
  return fetch("/nb-as/1.0.1/RoleService/queryRolePageTree", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改角色关联菜单
export function updateRolePage(data) {
  return fetch("/nb-as/1.0.1/RoleService/updateRolePage", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
